import diyApi from "@/api/declaration/mall/diyApi"
import httpRequest from "@/config/axios/httpRequest"
import { DiyPageModel } from "@/models/mall/DiyPageModel"


// 查询装修页面列表
export const getDiyPagePage = async (params: any) => {
  return await httpRequest.get(diyApi.GetDiyPagePage, { params })
}

// 查询装修页面详情
export const getDiyPage = async (id: number) => {
  return await httpRequest.get(diyApi.GetDiyPage, { params: { id } })
}

// 新增装修页面
export const createDiyPage = async (data: DiyPageModel) => {
  return await httpRequest.post(diyApi.CreateDiyPage, data)
}

// 修改装修页面
export const updateDiyPage = async (data: DiyPageModel) => {
  return await httpRequest.put(diyApi.UpdateDiyPage, data)
}

// 删除装修页面
export const deleteDiyPage = async (id: number) => {
  return await httpRequest.delete(diyApi.DeleteDiyPage, { params: { id } })
}

// 获得装修页面属性
export const getDiyPageProperty = async (id: number) => {
  return await httpRequest.get(diyApi.GetDiyPageProperty, { params: { id } })
}

// 更新装修页面属性
export const updateDiyPageProperty = async (data: DiyPageModel) => {
  return await httpRequest.put(diyApi.UpdateDiyPageProperty, data)
}
